﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ACM_AdjustTransection.aspx.cs" Inherits="KPIS.GERP.GAMS.APP.App_UI.Forms.ACM_AdjustTransection" %>

<%@ Register Src="~/App_UI/UserControls/DatePicker.ascx" TagPrefix="uc1" TagName="DatePicker" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>รายการปรับปรุงบัญชี</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" src="../Scripts/DatePicker.js" type="text/jscript"></script>
</head>
<body style="padding: 0px; margin: 0px">
    <form id="form1" runat="server" style="font-family: 'Tahoma'; font-size: small;">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="divTransection">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="divTransection" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="divTransectionDtls" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="divEditTransectionDtls" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="divTransectionDtls">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="divTransectionDtls" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="divEditTransectionDtls" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="divEditTransectionDtls">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="divTransectionDtls" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="divEditTransectionDtls" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    <div>
        <div class="TextHeader">
            [<asp:Label ID="lblModeName" runat="server" />]รายการปรับปรุงบัญชี
        </div>
        <div id="divTransection" runat="server">
            <table>
                <tr>
                    <td width="130px" align="right">
                        แหล่งเงิน :
                    </td>
                    <td width="320px">
                        <asp:Label ID="lblTranSeq" runat="server" Visible="false"></asp:Label>
                        <asp:Label ID="lblFiscalPeriod" runat="server" Visible="false"></asp:Label>
                        <asp:Label ID="lblTranGrpSeq" runat="server" Visible="false"></asp:Label>
                        <asp:Label ID="lblRecordStatus" runat="server" Visible="false"></asp:Label>
                        <telerik:RadComboBox ID="ddlBgmSourceSeq" runat="server" Width="300px"
                            DataTextField="bgm_source_name" DataValueField="bgm_source_seq"
                            Filter="Contains">
                        </telerik:RadComboBox>
                    </td>
                    <td width="130px" align="right">
                        ปีงบประมาณ :
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="txtBgmYear" runat="server"
                            MaxLength="4" MinValue="2500" MaxValue="2600"
                            NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="9" 
                            ShowSpinButtons="true"  >
                            <NumberFormat ZeroPattern="n" DecimalDigits="0" GroupSizes="9"></NumberFormat>
                        </telerik:RadNumericTextBox>
                    </td>
                </tr>
            </table>
            <table width="100%">
                <tr>
                    <td width="130px" align="right">
                        วันที่ทำรายการ :
                    </td>
                    <td>
                        <uc1:DatePicker runat="server" ID="dpTranDate" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="130px" align="right">
                        รหัสรายการ :
                    </td>
                    <td>
                        <asp:Label ID="lblTranCode" runat="server" ForeColor="Blue"></asp:Label>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="130px" align="right">
                        ชื่อรายการบัญชี :
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtTranName" runat="server" Width="550px"></telerik:RadTextBox>
                    </td>
                </tr>
            </table>
            <table>
                <tr style="vertical-align: top">
                    <td width="130px" align="right" style="padding-top:5px">
                        หมายเหตุ :
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtRemarks" runat="server" Width="550px" Height="70px" TextMode="MultiLine"></telerik:RadTextBox>
                    </td>
                </tr>
            </table>
            <div class="DivInfo" style="text-align:center">
                <asp:Button ID="cmdInsert1" runat="server" Text="บันทึก" OnClick="cmdInsert1_Click" />
                <asp:Button ID="cmdUpdate1" runat="server" Text="แก้ไข" OnClick="cmdUpdate1_Click" />&nbsp;&nbsp;
                <%--<asp:Button ID="cmdCancel1" runat="server" Text="ยกเลิกแก้ไข" OnClick="cmdCancel1_Click" />&nbsp;&nbsp;--%>
                <asp:Button ID="cmdDelete1" runat="server" Text="ลบรายการ" OnClick="cmdDelete1_Click" />&nbsp;&nbsp;
            </div>
        </div>
        <asp:Button ID="cmdPrint1" runat="server" Text="รายงาน" OnClick="cmdPrint1_Click" />
        <div id="divTransectionDtls" runat="server" visible="false">
            <div class="DivInfo" style="text-align:center">
                <asp:Button ID="cmdAddNew" runat="server" Text="เพิ่มรายการ Dr Cr" OnClick="cmdAddNew_Click" />
            </div>
            <telerik:RadGrid ID="RadGridTransectionDtls" runat="server" AutoGenerateColumns="false"
                AllowMultiRowEdit="false" AllowMultiRowSelection="true" 
                Width="848px" Height="295px" AllowPaging="true" AllowFilteringByColumn="false"
                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                GroupingSettings-GroupContinuedFormatString=""
                GroupingSettings-GroupContinuesFormatString=""
                GroupingSettings-GroupSplitFormat="" 
                OnItemCommand="RadGridTransectionDtls_ItemCommand" align ="center"
                ShowFooter="false">
                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client" Width="100%"
                    DataKeyNames="tran_dtls_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn UniqueName="tran_dtls_seq" DataField="tran_dtls_seq" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="tran_seq" DataField="tran_seq" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="account_seq" DataField="account_seq" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="dr_or_cr" DataField="dr_or_cr" Visible="false">
                    </telerik:GridBoundColumn>

                    <telerik:GridTemplateColumn HeaderText="แก้ไข" HeaderStyle-Font-Bold="true" HeaderStyle-Width="40" HeaderStyle-HorizontalAlign="Center" >
                        <FilterTemplate>
                        </FilterTemplate>
                        <ItemTemplate>
                            <asp:ImageButton ID="btnEdit" runat="server" CommandName="DataEdit" ImageUrl="~/App_UI/Images/Buttons/Edit.gif"  ToolTip="แก้ไขข้อมูล" width="17"/>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="ลบ" HeaderStyle-Font-Bold="true" HeaderStyle-Width="35" HeaderStyle-HorizontalAlign="Center">
                        <FilterTemplate>
                        </FilterTemplate>
                        <ItemTemplate>
                            <asp:ImageButton ID="btnSave" runat="server" CommandName="Delete" ImageUrl="~/App_UI/Images/Buttons/Delete.gif"  ToolTip="ลบรายการ" width="17" OnClientClick="javascript: return confirm('ต้องการลบรายการนี้หรือไม่?');"/>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="account_code" 
                        HeaderText="รหัสบัญชี" UniqueName="account_code"
                        FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" ShowFilterIcon="false" >
                        <HeaderStyle HorizontalAlign="Center" Font-Bold="true" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="account_name" 
                        HeaderText="ชื่อบัญชี" UniqueName="account_name"
                        FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" ShowFilterIcon="false" >
                        <HeaderStyle HorizontalAlign="Center" Font-Bold="true" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="debit_amount" 
                        HeaderText="Dr" UniqueName="debit_amount"
                        FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" ShowFilterIcon="false" ItemStyle-HorizontalAlign="Right"
                        Aggregate="Sum" DataFormatString="{0:n2}">
                        <HeaderStyle HorizontalAlign="Center" Font-Bold="true" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="credit_amount" 
                        HeaderText="Cr" UniqueName="credit_amount"
                        FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                        CurrentFilterFunction="Contains" ShowFilterIcon="false" ItemStyle-HorizontalAlign="Right"
                        Aggregate="Sum" DataFormatString="{0:n2}">
                        <HeaderStyle HorizontalAlign="Center" Font-Bold="true" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                </Columns>
                <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                    FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                    NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                    PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                </MasterTableView>
                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                    GroupContinuedFormatString="" GroupContinuesFormatString="" 
                    GroupSplitFormat="" />
                <ClientSettings EnableRowHoverStyle="True">
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </div>
        <div id="divEditTransectionDtls" runat="server" visible="false">
            <div class="TextHeader">
                [<asp:Label ID="lblModeName2" runat="server" />] Dr / Cr
            </div>

            <table>
                <tr>
                    <td width="130px" align="right">
                        รหัสบัญชี :
                    </td>
                    <td>
                        <asp:Label ID="lblTranDtlsSeq" runat="server" Visible="false"></asp:Label>
                        <telerik:RadComboBox ID="ddlAccountSeq" runat="server"
                            DataTextField="account_code_name" DataValueField="account_seq"
                            Filter="Contains" Width="300px">
                        </telerik:RadComboBox>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="130px" align="right">
                        
                    </td>
                    <td>
                        <asp:RadioButtonList ID="rdlDrOrCr" runat="server" RepeatDirection="Horizontal" Width="200px">
                            <asp:ListItem Text="Dr" Value="Dr" Selected="True" />
                            <asp:ListItem Text="Cr" Value="Cr" />
                        </asp:RadioButtonList>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td width="130px" align="right">
                        จำนวนเงิน :
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="txtAmount" runat="server" CssClass="NumericTextBox"></telerik:RadNumericTextBox>
                    </td>
                </tr>
            </table>
            <div class="DivInfo" style="text-align:center">
                <asp:Button ID="cmdInsert2" runat="server" Text="บันทึก" OnClick="cmdInsert2_Click" />
                <asp:Button ID="cmdUpdate2" runat="server" Text="แก้ไข" OnClick="cmdUpdate2_Click" />&nbsp;&nbsp;
                <asp:Button ID="cmdCancel2" runat="server" Text="ยกเลิกแก้ไข" OnClick="cmdCancel2_Click" />
            </div>
        </div>
    </div>
    </form>
</body>
</html>
